<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,usesr-scalable=0">
	<meta name="keywods" content="">
	<meta name="description" content="">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="blank">
	<meta name="format-detection" content="telephone=no">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>建议留言</title>
	<!-- <link rel="shortcut icon" href="__INDEX__/images/logo.ico"> -->
	<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
	<link rel="stylesheet" href="__INDEX__/css/top.css">
	<link rel="stylesheet" href="__INDEX__/css/proposal.css">
	<script src="__INDEX__/js/flexible_css.js"></script>
	<script src="__INDEX__/js/flexible.js"></script>
	<script src="__INDEX__/js/jquery-1.12.4.min.js"></script>
	<script src="__INDEX__/js/swiper.jquery.min.js"></script>
</head>

<body>
	<div class="wrap">
		<!-- 头部 -->
		{include file="public/header" /}
		<div class="content">
			<div class="c-title">
				建议留言
			</div>
			<div class="c-content">
				<form action="{:url('index/message/index')}" method="post">
					<div class="information">
						<h1>个人信息</h1>
						<div class="box">
							<p>姓名</p>
							<input type="" name="user_name" id="name" value="" placeholder="请输入您的姓名" />
						</div>
						<div class="box">
							<p>电话</p>
							<input type="" name="phone" id="phone" value="" placeholder="请输入您的电话号码" />
						</div>
						<div class="box">
							<p>邮箱</p>
							<input type="" name="email" id="mailbox" value="" placeholder="请输入您的邮箱" />
						</div>
						<div class="box">
							<p>地址</p>
							<input type="" name="address" id="address" value="" placeholder="请输入您的地址" />
						</div>
						<div class="message">
							<p>是否公开留言</p>

							<label for="open" class="radio">
								<input type="radio" name="is_show" id="open" value="1" checked="checked" class="a-radio" />
								<span class="b-radio"></span>公开
							</label>
							<label for="notOpen" class="radio">
								<input type="radio" name="is_show" id="notOpen" value="0" class="a-radio" />
								<span class="b-radio"></span>不公开
							</label>
						</div>
					</div>
					<div class="proposal">
						<h1>建议内容</h1>
						<textarea name="contents" maxlength="10000" placeholder="请输入您的宝贵建议 （500字以内）" ></textarea>
					</div>
					<!-- 留言成功跳转页面suc.html -->
					<input type="submit" value="提交留言" class="submit" onclick="return res()"/>
				</form>
			</div>
		</div>
		<!-- 底部导航栏 -->
		{include file="public/footer" /}

	</div>

	<script type="text/javascript">
		var isphone=false;
		$('.header ul li a').eq(2).css('color','#0860a8');
		//手机号码正则判断
		$('#phone').change(function () {
			var value = $.trim($('#phone').val() );

			//var myreg = "/^[1][3,4,5,7,8][0-9]{9}$/";
			var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;  
			if (!phoneReg.test(value)) {  
			    alert('请输入有效的手机号码！');  
			    return false;  
			}else{
				isphone=true;
				return true;
			}
			// if (!myreg.test(value) ) {
			// 	alert("请输入正确的手机号码!");
			// 	return;
			// } else {
			// 	isphone=true;
			// 	return;
			// }
		})
		
		//邮箱正则判断
		$('#mailbox').change(function () {
			var value = $('#mailbox').val()
			var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			if (!filter.test(value)) {
				alert("请输入正确的有邮箱!");
			} else {
				isemail=true;
				return;
			}
		})

		function res(){
			if(!isphone ){
				alert('请填写您的联系方式!方便我们改进您的意见！');
				return false;
			}{
				return true;
			}
		}
	</script>
</body>

</html>